/*
 *  The hdd.h header file defines some functions to manage the IDE hard disk
 */

#ifndef _HDD_H
#define _HDD_H

#include <types.h>

extern void hdd_initialize(void);
extern void hdd_read_sector(int drive,int lba,int count,byte_t *buffer);
extern void hdd_write_sector(int drive,int lba,int count,byte_t *buffer);
extern int hdd_detect(int controller_port,int drive);

// utility functions for converting LVA to CHS and vice-versa
extern int lba_to_chs(long lba,int *c,int *h,int *s);
extern void chs_to_lba(int c,int h,int s,long *lba);
extern dword_t disk_to_minor(int controller,int disk,int partition);
extern void minor_to_disk(dword_t minor,int *controller,int *disk,int *partition);

#endif /* _HDD_H */
